<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div class="example">
        <my-component></my-component>
        <local-component></local-component>
    </div>
    <script src="../js/vue.js" charset="utf-8"></script>
    <script type="text/javascript">
        //注册
        Vue.component('my-component', {
            template: '<div>A custom component!</div>'
        })

        var Child = {
            template: '<div>A Local component !</div>'
        }

        //创建实例
        var vm = new Vue({
            el: '.example',
            components: {
                'local-component': Child
            }
        })
    </script>
</body>
</html>
